/*
 * @Date: 2023-03-11 14:59:29
 * @LastEditors: Zireael 1193875164@qq.com
 * @LastEditTime: 2023-03-11 16:13:10
 * @FilePath: \A19\backend\src\api\Experiment\ApiCreateExp.ts
 */
import { ApiCall } from "tsrpc";
import { ReqCreateExp, ResCreateExp } from "../../shared/protocols/Experiment/PtlCreateExp";
import { Global } from '../../Global/index';

export default async function (call: ApiCall<ReqCreateExp, ResCreateExp>) {
    // TODO
    const {course,name,startTime,endTime,language,questions} = call.req
    const ret = await Global.collection('experiments').insertOne({
        course,
        name,
        startTime,
        endTime,
        language,
        questions
    })

    call.succ({})
}